package com.autumn.security.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.context.annotation.Import;

import com.autumn.security.configure.AutumnPermissionFilterRegister;
import com.autumn.security.configure.AutumnSecurityCacheProviderConfiguration;
import com.autumn.security.configure.AutumnSecurityConfiguration;
import com.autumn.security.configure.DefaultAutumnPermissionFilter;
import com.autumn.security.configure.IAutumnPermissionFilter;

/**
 * 启用 Autumn 安全
 * 
 * @author 杨昌国 2018-12-06 14:00:55
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Import({ AutumnPermissionFilterRegister.class, AutumnSecurityCacheProviderConfiguration.class,
		AutumnSecurityConfiguration.class })
public @interface EnableAutumnSecurity {

	/**
	 * 权限类型属性名称
	 */
	public static final String PERMISSION_FILTER_TYPE_ATTRIBUTE_NAME = "permissionFilterType";

	/**
	 * 权限过滤类型
	 * 
	 * @return
	 */
	Class<? extends IAutumnPermissionFilter> permissionFilterType() default DefaultAutumnPermissionFilter.class;

}
